<?php
class ChangeController extends Controller{
	private $db;
	public function __init(){
		$this->db=new AdminModel;
	}
	//修改密码
	public function change(){
		if(IS_POST){
			if($this->db->change($_POST)){
				$this->assign('aid',$_SESSION['aid']);
				$this->display('new.html');
			}else{
				$this->error($this->db->error);
			}
		}else{
			$this->display('old.html');
		}
	}
	//确认新密码
	public function newPwd(){
		if($this->db->newPwd($_POST)){
			$this->success('修改密码成功',__MODULE__.'&c=Login&a=login');
		}else{
			$this->error('修改密码失败');
		}
	}
}
?>